<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>字符串的replace方法</title>
</head>
<body>
<a data-m="sunq">曹操</a>

<script>
//    字符串的replace方法，第二个参数可以是函数
    var mystring = "i want success";
//    mystring.replace("want",function () {
//
//        });
    mystring.replace("want","really want");
//    console.log(mystring);
    console.log(mystring.replace("want","really want"));
    console.log(document.getElementsByTagName("a")[0].dataset.m);


</script>
</body>
</html>